package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Poetry;
import com.example.demo.entity.Recite;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ReciteMapper extends BaseMapper<Recite> {

    @Select("select * from lv_writing_works where author_id = #{authorId} limit #{number},1")
    Poetry selectPoetryByReciteCount(@Param("authorId") Integer authorId, @Param("number") Integer number);

    @Select("SELECT COUNT(*) FROM lv_writing_works WHERE author_id = #{authorId}")
    Integer selectCountByAuthorId(@Param("authorId") Integer authorId);

}
